#tag Module
Protected Module EditFieldExtends
	#tag Method, Flags = &h0
		Function CurrentWord(extends e as editfield) As String
		  Dim substr as String
		  If e.SelLength > 0 Then
		    substr = e.SelText
		  else
		    substr = left( e.Text, e.SelStart )
		  End If
		  substr = ReplaceLineEndings( substr, " " )
		  substr = ReplaceAll(substr, ".", " ")
		  substr = ReplaceAll(substr, ",", " ")
		  dim max as Integer = CountFields( substr, " " )
		  Return NthField(substr, " ", max )
		End Function
	#tag EndMethod


	#tag ViewBehavior
		#tag ViewProperty
			Name="Name"
			Visible=true
			Group="ID"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Index"
			Visible=true
			Group="ID"
			InitialValue="-2147483648"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Super"
			Visible=true
			Group="ID"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Left"
			Visible=true
			Group="Position"
			InitialValue="0"
			InheritedFrom="Object"
		#tag EndViewProperty
		#tag ViewProperty
			Name="Top"
			Visible=true
			Group="Position"
			InitialValue="0"
			InheritedFrom="Object"
		#tag EndViewProperty
	#tag EndViewBehavior
End Module
#tag EndModule
